package com.hooper.hosp.repository;

import com.hooper.hosp.model.hosp.Schedule;
import org.joda.time.DateTime;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * @author Tim Hooper
 * @version 1.0
 * @time 2022/09/28/18:31
 */
@Repository
public interface ScheduleRepository extends MongoRepository<Schedule,String> {
    /**
     *
     * get one via schedule id
     * @param hosScheduleId schedule id
     * @return schedule
     */
    Schedule findScheduleByHosScheduleId(String hosScheduleId);

    /**
     * remove
     * @param hoscode hosp id
     * @param scheduleId schedule id
     */
    void removeByHoscodeAndHosScheduleId(String hoscode, String scheduleId);

    /**
     * find all schedules of the department by its hoscode and department code
     * @param hoscode hosp code
     * @param depcode department code
     * @return        all the schedules
     */
    List<Schedule> findAllByHoscodeAndDepcode(String hoscode, String depcode);
    /**
     * find all schedules of the department by its hoscode and department code
     * @param hoscode hosp code
     * @param depcode department code
     * @param workDate time
     * @return        all the schedules
     */
    List<Schedule> findAllByHoscodeAndDepcodeAndWorkDate(String hoscode, String depcode, Date workDate);

    /**
     * get schedule by id
     * @param scheduleId id
     * @return
     */
    Schedule findScheduleById(String scheduleId);

}
